<script>
import { routes } from "@/router/index";
export default {
    name: 'AsideCom',
    props: ['collapse'],
    data() {
        return {
            routes: routes[0].children
        }
    },
}
</script>
<template>
    <el-menu router :collapse-transition="false" :collapse="collapse" default-active="2" class="el-menu-vertical-demo">

        <el-menu-item index="aaa">
            <el-icon>
                <HomeFilled />
            </el-icon>
            <span>首页 {{ $store.state.count }} </span>
        </el-menu-item>



        <el-sub-menu v-for="item in routes" :key="item.path" :index="item.path">
            <template #title>
                <el-icon>
                    <UserFilled />
                </el-icon>
                <span>{{ item.label }}</span>
            </template>
            <el-menu-item-group>
                <el-menu-item v-for="child in item.children" :key="child.path" :index="`/${item.path}/${child.path}`">
                    <template #title>
                        <el-icon>
                            <UserFilled />
                        </el-icon>
                        <span>{{ child.label }}</span>
                    </template>
                </el-menu-item>
            </el-menu-item-group>
        </el-sub-menu>


        <!-- <el-sub-menu index="1">
            <template #title>
                <el-icon>
                    <UserFilled />
                </el-icon>
                <span>用户管理</span>
            </template>
            <el-menu-item-group>
                <el-menu-item index="1-1">
                    <template #title>
                        <el-icon>
                            <UserFilled />
                        </el-icon>
                        <span>用户列表</span>
                    </template>
                </el-menu-item>
                <el-menu-item index="1-2">
                    <template #title>
                        <el-icon>
                            <UserFilled />
                        </el-icon>
                        <span>管理员列表</span>
                    </template>
                </el-menu-item>
            </el-menu-item-group>
        </el-sub-menu> -->
    </el-menu>
</template>